# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/go/.devcontainer/base.Dockerfile

# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
ARG VARIANT="1.17-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="16"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
#     && apt-get -y install --no-install-recommends <your-package-list-here>

# 设定环境变量
# 启用GOMODULE
ENV GO111MODULE=on
# 启用golang包镜像代理(七牛)
ENV GOPROXY="https://goproxy.cn,direct"

# 调整工作路径
WORKDIR /app

# [Optional] Uncomment the next line to use go get to install anything else you need
# RUN go get -x <your-dependency-or-tool>
# RUN go mod init gitee.com/jimgo/sh3home
# RUN go get github.com/labstack/echo/v4
# RUN go mod download
# RUN go mod tidy

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

# 启用npm包镜像代理(淘宝)
RUN npm config set registry https://registry.npmmirror.com
# 初始化vite npm 版本7.24
# 使用 vue-ts
# RUN npm init vite@latest  --sh3home --template vue-ts


# Debian 镜像加速。Debian 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份，将该文件替换为下面内容
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
  echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free >/etc/apt/sources.list && \
  echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free >>/etc/apt/sources.list && \
  echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free >>/etc/apt/sources.list && \
  echo deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free >>/etc/apt/sources.list
# echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free >>/etc/apt/sources.list && \
# echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free >>/etc/apt/sources.list && \
# echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free >>/etc/apt/sources.list && \
# echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free >>/etc/apt/sources.list && \